package com.weaver.openapi.service;

import com.weaver.openapi.pojo.eb.params.table.*;
import com.weaver.openapi.pojo.eb.res.table.*;
import com.weaver.openapi.util.*;
import java.util.*;
import cn.hutool.http.*;
import com.alibaba.fastjson.*;

public class EbTableService
{
    public static EbTableResultVo getSearchFilters(final EbTableVo tableVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", tableVo.getAccessToken());
        paramMap.put("userid", tableVo.getUserid());
        paramMap.put("listId", tableVo.getListId());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/api/ebuilder/form/formcfg/list/listFilter/v1/getSearchFilters").body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (EbTableResultVo)JSONObject.parseObject(resJson, (Class)EbTableResultVo.class);
    }
    
    public static EbTableResultVo listInit(final EbTableVo tableVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", tableVo.getAccessToken());
        paramMap.put("userid", tableVo.getUserid());
        paramMap.put("listId", tableVo.getListId());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/api/ebuilder/form/formcfg/list/v1/listInit").body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (EbTableResultVo)JSONObject.parseObject(resJson, (Class)EbTableResultVo.class);
    }
    
    public static EbTableResultVo getListPermission(final EbTableVo tableVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", tableVo.getAccessToken());
        paramMap.put("userid", tableVo.getUserid());
        paramMap.put("listId", tableVo.getListId());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/api/ebuilder/form/formcfg/list/permission/v1/getList").body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (EbTableResultVo)JSONObject.parseObject(resJson, (Class)EbTableResultVo.class);
    }
    
    public static EbTableResultVo getListDatas(final EbTableVo tableVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", tableVo.getAccessToken());
        paramMap.put("userid", tableVo.getUserid());
        paramMap.put("listId", tableVo.getListId());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/api/ebuilder/form/formcfg/list/v1/getListDatas").body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (EbTableResultVo)JSONObject.parseObject(resJson, (Class)EbTableResultVo.class);
    }
}
